home *** CD-ROM | disk | FTP | other *** search
/ Building Homes of Our Own / Building Homes of our Own.iso / setup / data1.cab / Everything / working / houCons.dxr / interface_871_SpecialFeaturesDisplay behave.ls < prev    next >
Encoding:
Text File  |  2002-09-25  |  1.8 KB  |  71 lines

  1. property mySprite, myType, myRegion, ancestor, curItem, curCost
  2.  
  3. on beginSprite me
  4.   global gUserDataMan, gActorListMan
  5.   unRegisterSprite(gActorListMan, mySprite)
  6.   mySprite = me.spriteNum
  7.   myRegion = getCurRegion(gUserDataMan)
  8.   myType = #SpecialFeaturesDisplay
  9.   registerSprite(gActorListMan, mySprite)
  10.   initSpecialFeaturesDisplay(me)
  11. end
  12.  
  13. on sendSpriteNum me, aType
  14.   if aType = myType then
  15.     return mySprite
  16.   end if
  17. end
  18.  
  19. on initSpecialFeaturesDisplay me
  20.   global gConMan
  21.   curItem = getNextOutdoorItem(gConMan)
  22.   set the member of sprite mySprite to member(curItem)
  23.   updateToolBarText(me)
  24. end
  25.  
  26. on updateToolBarText me
  27.   global gToolBarTextMan, gCostMan
  28.   curCost = getOutDoorItemCost(gCostMan, symbol(curItem))
  29.   itemString = getItemString(me)
  30.   displayString = "To install this" && itemString & ", hit the PURCHASE button. If you do not want to purchase this item, select CANCEL."
  31.   put RETURN & "Cost:" && formatMonetaryForDisplay(curCost) after displayString
  32.   useString = 1
  33.   setToolBarText(gToolBarTextMan, displayString, useString)
  34. end
  35.  
  36. on getItemString me
  37.   curItemToCompare = string(curItem)
  38.   case 1 of
  39.     (curItemToCompare contains "gazebo"):
  40.       itemString = "gazebo"
  41.     (curItemToCompare contains "skate"):
  42.       itemString = "skateboard park"
  43.     (curItemToCompare contains "basket"):
  44.       itemString = "bastketball court"
  45.     (curItemToCompare contains "garage"):
  46.       itemString = "garage"
  47.     (curItemToCompare contains "spa"):
  48.       itemString = "spa"
  49.     (curItemToCompare contains "pool"):
  50.       itemString = "pool"
  51.     (curItemToCompare contains "patio"):
  52.       itemString = "patio"
  53.     otherwise:
  54.       return curItemToCompare
  55.   end case
  56.   return itemString
  57. end
  58.  
  59. on endSprite me
  60.   global gActorListMan
  61.   unRegisterSprite(gActorListMan, mySprite)
  62. end
  63.  
  64. on getCurItem me
  65.   return curItem
  66. end
  67.  
  68. on getCurCost me
  69.   return curCost
  70. end
  71.